package code.google.model.player.states;

import android.media.MediaPlayer;
import code.google.model.util.interfaces.ISong;

public class State {
	
	protected StateManager manager;
	protected static MediaPlayer player;
	protected static ISong currentSong;

	public State(StateManager manager) {
		this.manager = manager;
	}
	
	public boolean play(){return false;}
	public boolean play(ISong song){return false;}
	public boolean pause(){return false;}
	public boolean seekTo(int position){return false;}
	
	protected void destroyMediaPlayer(){
		player.release();
		player = null;
	}
	public ISong getCurrentSong(){
		return currentSong;
	}
	
	public void destroy(){
		destroyMediaPlayer();
		manager.setCurrentState(manager.getStartState());
	}

	public boolean isPlaying() {
		if(player != null)
			return player.isPlaying();
		return false;
	}

}
